package com.google.code.stalkernet.database.event;

import java.util.EventObject;

import com.google.code.stalkernet.entry.Entry;

/**
 * Encapsulates details of database-related event.
 *
 * @author Mikhail Vladimirov
 */
public class DatabaseEvent extends EventObject
{
    private final Entry entry;

    /**
     * Create new database event with given source and entry.
     *
     * @param source event source
     * @param entry entry
     */
    public DatabaseEvent (Object source, Entry entry)
    {
        super (source);

        if (entry == null)
            throw new IllegalArgumentException ("Entry is null");

        this.entry = entry;
    }

    /**
     * Get entry.
     *
     * @return {@link Entry} object
     */
    public Entry getEntry ()
    {
        return entry;
    }
}
